# $ANTLR 3.1.3 Mar 17, 2009 19:23:44 regexs.g 2011-12-07 15:51:40

import sys
from antlr3 import *
from antlr3.compat import set, frozenset


# for convenience in actions
HIDDEN = BaseRecognizer.HIDDEN

# token types
CARACTER=4
OP=6
T__10=10
DOT=5
EOF=-1
T__9=9
T__8=8
T__7=7


class regexsLexer(Lexer):

    grammarFileName = "regexs.g"
    antlr_version = version_str_to_tuple("3.1.3 Mar 17, 2009 19:23:44")
    antlr_version_str = "3.1.3 Mar 17, 2009 19:23:44"

    def __init__(self, input=None, state=None):
        if state is None:
            state = RecognizerSharedState()
        super(regexsLexer, self).__init__(input, state)







    # $ANTLR start "T__7"
    def mT__7(self, ):

        try:
            _type = T__7
            _channel = DEFAULT_CHANNEL

            # regexs.g:7:6: ( '\\n' )
            # regexs.g:7:8: '\\n'
            pass 
            self.match(10)



            self._state.type = _type
            self._state.channel = _channel

        finally:

            pass

    # $ANTLR end "T__7"



    # $ANTLR start "T__8"
    def mT__8(self, ):

        try:
            _type = T__8
            _channel = DEFAULT_CHANNEL

            # regexs.g:8:6: ( '(' )
            # regexs.g:8:8: '('
            pass 
            self.match(40)



            self._state.type = _type
            self._state.channel = _channel

        finally:

            pass

    # $ANTLR end "T__8"



    # $ANTLR start "T__9"
    def mT__9(self, ):

        try:
            _type = T__9
            _channel = DEFAULT_CHANNEL

            # regexs.g:9:6: ( ')' )
            # regexs.g:9:8: ')'
            pass 
            self.match(41)



            self._state.type = _type
            self._state.channel = _channel

        finally:

            pass

    # $ANTLR end "T__9"



    # $ANTLR start "T__10"
    def mT__10(self, ):

        try:
            _type = T__10
            _channel = DEFAULT_CHANNEL

            # regexs.g:10:7: ( '|' )
            # regexs.g:10:9: '|'
            pass 
            self.match(124)



            self._state.type = _type
            self._state.channel = _channel

        finally:

            pass

    # $ANTLR end "T__10"



    # $ANTLR start "OP"
    def mOP(self, ):

        try:
            _type = OP
            _channel = DEFAULT_CHANNEL

            # regexs.g:99:3: ( '+' | '?' | '*' )
            # regexs.g:
            pass 
            if (42 <= self.input.LA(1) <= 43) or self.input.LA(1) == 63:
                self.input.consume()
            else:
                mse = MismatchedSetException(None, self.input)
                self.recover(mse)
                raise mse




            self._state.type = _type
            self._state.channel = _channel

        finally:

            pass

    # $ANTLR end "OP"



    # $ANTLR start "CARACTER"
    def mCARACTER(self, ):

        try:
            _type = CARACTER
            _channel = DEFAULT_CHANNEL

            # regexs.g:100:9: ( 'a' .. 'z' | 'A' .. 'Z' | '0' .. '9' | ' ' )
            # regexs.g:
            pass 
            if self.input.LA(1) == 32 or (48 <= self.input.LA(1) <= 57) or (65 <= self.input.LA(1) <= 90) or (97 <= self.input.LA(1) <= 122):
                self.input.consume()
            else:
                mse = MismatchedSetException(None, self.input)
                self.recover(mse)
                raise mse




            self._state.type = _type
            self._state.channel = _channel

        finally:

            pass

    # $ANTLR end "CARACTER"



    # $ANTLR start "DOT"
    def mDOT(self, ):

        try:
            _type = DOT
            _channel = DEFAULT_CHANNEL

            # regexs.g:101:4: ( '.' )
            # regexs.g:101:7: '.'
            pass 
            self.match(46)



            self._state.type = _type
            self._state.channel = _channel

        finally:

            pass

    # $ANTLR end "DOT"



    def mTokens(self):
        # regexs.g:1:8: ( T__7 | T__8 | T__9 | T__10 | OP | CARACTER | DOT )
        alt1 = 7
        LA1 = self.input.LA(1)
        if LA1 == 10:
            alt1 = 1
        elif LA1 == 40:
            alt1 = 2
        elif LA1 == 41:
            alt1 = 3
        elif LA1 == 124:
            alt1 = 4
        elif LA1 == 42 or LA1 == 43 or LA1 == 63:
            alt1 = 5
        elif LA1 == 32 or LA1 == 48 or LA1 == 49 or LA1 == 50 or LA1 == 51 or LA1 == 52 or LA1 == 53 or LA1 == 54 or LA1 == 55 or LA1 == 56 or LA1 == 57 or LA1 == 65 or LA1 == 66 or LA1 == 67 or LA1 == 68 or LA1 == 69 or LA1 == 70 or LA1 == 71 or LA1 == 72 or LA1 == 73 or LA1 == 74 or LA1 == 75 or LA1 == 76 or LA1 == 77 or LA1 == 78 or LA1 == 79 or LA1 == 80 or LA1 == 81 or LA1 == 82 or LA1 == 83 or LA1 == 84 or LA1 == 85 or LA1 == 86 or LA1 == 87 or LA1 == 88 or LA1 == 89 or LA1 == 90 or LA1 == 97 or LA1 == 98 or LA1 == 99 or LA1 == 100 or LA1 == 101 or LA1 == 102 or LA1 == 103 or LA1 == 104 or LA1 == 105 or LA1 == 106 or LA1 == 107 or LA1 == 108 or LA1 == 109 or LA1 == 110 or LA1 == 111 or LA1 == 112 or LA1 == 113 or LA1 == 114 or LA1 == 115 or LA1 == 116 or LA1 == 117 or LA1 == 118 or LA1 == 119 or LA1 == 120 or LA1 == 121 or LA1 == 122:
            alt1 = 6
        elif LA1 == 46:
            alt1 = 7
        else:
            nvae = NoViableAltException("", 1, 0, self.input)

            raise nvae

        if alt1 == 1:
            # regexs.g:1:10: T__7
            pass 
            self.mT__7()


        elif alt1 == 2:
            # regexs.g:1:15: T__8
            pass 
            self.mT__8()


        elif alt1 == 3:
            # regexs.g:1:20: T__9
            pass 
            self.mT__9()


        elif alt1 == 4:
            # regexs.g:1:25: T__10
            pass 
            self.mT__10()


        elif alt1 == 5:
            # regexs.g:1:31: OP
            pass 
            self.mOP()


        elif alt1 == 6:
            # regexs.g:1:34: CARACTER
            pass 
            self.mCARACTER()


        elif alt1 == 7:
            # regexs.g:1:43: DOT
            pass 
            self.mDOT()







 



def main(argv, stdin=sys.stdin, stdout=sys.stdout, stderr=sys.stderr):
    from antlr3.main import LexerMain
    main = LexerMain(regexsLexer)
    main.stdin = stdin
    main.stdout = stdout
    main.stderr = stderr
    main.execute(argv)


if __name__ == '__main__':
    main(sys.argv)
